#ifndef __STORMWIDGET_STORMWIDGET_UILIBRARY_CLISTEXPANDELEMENTUI_LISTEXPANDELEMENTUI_H
#define __STORMWIDGET_STORMWIDGET_UILIBRARY_CLISTEXPANDELEMENTUI_LISTEXPANDELEMENTUI_H

#include "ListTextElementUI.h"
#include "ContainerUI.h"

class CPaintManagerUI;
class CControlUI;

class CListExpandElementUI:public CListTextElementUI,public IContainerUI
{
public:
	CListExpandElementUI(void);
	virtual ~CListExpandElementUI(void);

	LPCTSTR GetClass() const;

	void SetPos(RECT rc);
	void Event(TEventUI& event);
	SIZE EstimateSize(SIZE szAvailable);
	void DoPaint(HDC hDC, const RECT& rcPaint);

	void SetManager(CPaintManagerUI* pManager, CControlUI* pParent);
	CControlUI* FindControl(FINDCONTROLPROC Proc, LPVOID pData, UINT uFlags);

	CControlUI* GetItem(int iIndex) const;
	int GetCount() const;
	bool Add(CControlUI* pControl);
	bool Remove(CControlUI* pControl);
	void RemoveAll();

	bool IsExpanded() const;
	bool Expand(bool bExpand = true);

	void DrawItem(HDC hDC, const RECT& rcItem, UINT uStyle);

protected:
	bool m_bExpanded;
	int m_cyExpanded;
	CContainerUI* m_pContainer;
};
#endif //__STORMWIDGET_STORMWIDGET_UILIBRARY_CLISTEXPANDELEMENTUI_LISTEXPANDELEMENTUI_H
